Integrand size = 17, antiderivative size = 88 \[ \int \sin ^2(a+b x) \sin ^2(c+d x) \, dx=\frac {x}{4}-\frac {\sin (2 a+2 b x)}{8 b}+\frac {\sin (2 (a-c)+2 (b-d) x)}{16 (b-d)}-\frac {\sin (2 c+2 d x)}{8 d}+\frac {\sin (2 (a+c)+2 (b+d) x)}{16 (b+d)} \]
1/4*x-1/8*sin(2*b*x+2*a)/b+1/16*sin(2*a-2*c+2*(b-d)*x)/(b-d)-1/8*sin(2*d*x +2*c)/d+1/16*sin(2*a+2*c+2*(b+d)*x)/(b+d)
Time = 0.85 (sec) , antiderivative size = 106, normalized size of antiderivative = 1.20 \[ \int \sin ^2(a+b x) \sin ^2(c+d x) \, dx=\frac {\left (-2 b^2 d+2 d^3\right ) \sin (2 (a+b x))+b d (b+d) \sin (2 (a-c+(b-d) x))+b (b-d) (-2 (b+d) \sin (2 (c+d x))+d (4 (b+d) x+\sin (2 (a+c+(b+d) x))))}{16 b (b-d) d (b+d)} \]
((-2*b^2*d + 2*d^3)*Sin[2*(a + b*x)] + b*d*(b + d)*Sin[2*(a - c + (b - d)* x)] + b*(b - d)*(-2*(b + d)*Sin[2*(c + d*x)] + d*(4*(b + d)*x + Sin[2*(a + c + (b + d)*x)])))/(16*b*(b - d)*d*(b + d))
Time = 0.26 (sec) , antiderivative size = 88, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.118, Rules used = {5080, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \sin ^2(a+b x) \sin ^2(c+d x) \, dx\) |
\(\Big \downarrow \) 5080 |
\(\displaystyle \int \left (\frac {1}{8} \cos (2 (a-c)+2 x (b-d))+\frac {1}{8} \cos (2 (a+c)+2 x (b+d))-\frac {1}{4} \cos (2 a+2 b x)-\frac {1}{4} \cos (2 c+2 d x)+\frac {1}{4}\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {\sin (2 (a-c)+2 x (b-d))}{16 (b-d)}+\frac {\sin (2 (a+c)+2 x (b+d))}{16 (b+d)}-\frac {\sin (2 a+2 b x)}{8 b}-\frac {\sin (2 c+2 d x)}{8 d}+\frac {x}{4}\) |
x/4 - Sin[2*a + 2*b*x]/(8*b) + Sin[2*(a - c) + 2*(b - d)*x]/(16*(b - d)) - Sin[2*c + 2*d*x]/(8*d) + Sin[2*(a + c) + 2*(b + d)*x]/(16*(b + d))
3.3.3.3.1 Defintions of rubi rules used
Int[Sin[v_]^(p_.)*Sin[w_]^(q_.), x_Symbol] :> Int[ExpandTrigReduce[Sin[v]^p *Sin[w]^q, x], x] /; ((PolynomialQ[v, x] && PolynomialQ[w, x]) || (Binomial Q[{v, w}, x] && IndependentQ[Cancel[v/w], x])) && IGtQ[p, 0] && IGtQ[q, 0]
Time = 0.82 (sec) , antiderivative size = 89, normalized size of antiderivative = 1.01
method | result | size |
default | \(\frac {x}{4}-\frac {\sin \left (2 x b +2 a \right )}{8 b}-\frac {\sin \left (2 d x +2 c \right )}{8 d}+\frac {\sin \left (\left (2 b -2 d \right ) x +2 a -2 c \right )}{16 b -16 d}+\frac {\sin \left (\left (2 b +2 d \right ) x +2 a +2 c \right )}{16 b +16 d}\) | \(89\) |
parallelrisch | \(\frac {b d \left (b +d \right ) \sin \left (\left (2 b -2 d \right ) x +2 a -2 c \right )+4 \left (\frac {b d \sin \left (\left (2 b +2 d \right ) x +2 a +2 c \right )}{4}+\left (b +d \right ) \left (-\frac {d \sin \left (2 x b +2 a \right )}{2}+b \left (d x -\frac {\sin \left (2 d x +2 c \right )}{2}\right )\right )\right ) \left (b -d \right )}{16 b^{3} d -16 b \,d^{3}}\) | \(104\) |
risch | \(\frac {x}{4}-\frac {\sin \left (2 x b +2 a \right )}{8 b}-\frac {\sin \left (2 d x +2 c \right ) b^{2}}{8 d \left (b -d \right ) \left (b +d \right )}+\frac {d \sin \left (2 d x +2 c \right )}{8 \left (b -d \right ) \left (b +d \right )}+\frac {\sin \left (2 x b -2 d x +2 a -2 c \right ) b}{16 \left (b -d \right ) \left (b +d \right )}+\frac {d \sin \left (2 x b -2 d x +2 a -2 c \right )}{16 \left (b -d \right ) \left (b +d \right )}+\frac {\sin \left (2 x b +2 d x +2 a +2 c \right ) b}{16 \left (b -d \right ) \left (b +d \right )}-\frac {d \sin \left (2 x b +2 d x +2 a +2 c \right )}{16 \left (b -d \right ) \left (b +d \right )}\) | \(196\) |
1/4*x-1/8*sin(2*b*x+2*a)/b-1/8*sin(2*d*x+2*c)/d+1/8/(2*b-2*d)*sin((2*b-2*d )*x+2*a-2*c)+1/8/(2*b+2*d)*sin((2*b+2*d)*x+2*a+2*c)
Time = 0.26 (sec) , antiderivative size = 118, normalized size of antiderivative = 1.34 \[ \int \sin ^2(a+b x) \sin ^2(c+d x) \, dx=-\frac {{\left (2 \, b d^{2} \cos \left (b x + a\right )^{2} + b^{3} - 2 \, b d^{2}\right )} \cos \left (d x + c\right ) \sin \left (d x + c\right ) - {\left (b^{3} d - b d^{3}\right )} x - {\left (2 \, b^{2} d \cos \left (b x + a\right ) \cos \left (d x + c\right )^{2} - {\left (2 \, b^{2} d - d^{3}\right )} \cos \left (b x + a\right )\right )} \sin \left (b x + a\right )}{4 \, {\left (b^{3} d - b d^{3}\right )}} \]
-1/4*((2*b*d^2*cos(b*x + a)^2 + b^3 - 2*b*d^2)*cos(d*x + c)*sin(d*x + c) - (b^3*d - b*d^3)*x - (2*b^2*d*cos(b*x + a)*cos(d*x + c)^2 - (2*b^2*d - d^3 )*cos(b*x + a))*sin(b*x + a))/(b^3*d - b*d^3)
Leaf count of result is larger than twice the leaf count of optimal. 1027 vs. \(2 (76) = 152\).
Time = 1.53 (sec) , antiderivative size = 1027, normalized size of antiderivative = 11.67 \[ \int \sin ^2(a+b x) \sin ^2(c+d x) \, dx=\text {Too large to display} \]
Piecewise((x*sin(a)**2*sin(c)**2, Eq(b, 0) & Eq(d, 0)), ((x*sin(c + d*x)** 2/2 + x*cos(c + d*x)**2/2 - sin(c + d*x)*cos(c + d*x)/(2*d))*sin(a)**2, Eq (b, 0)), (3*x*sin(a - d*x)**2*sin(c + d*x)**2/8 + x*sin(a - d*x)**2*cos(c + d*x)**2/8 - x*sin(a - d*x)*sin(c + d*x)*cos(a - d*x)*cos(c + d*x)/2 + x* sin(c + d*x)**2*cos(a - d*x)**2/8 + 3*x*cos(a - d*x)**2*cos(c + d*x)**2/8 - 5*sin(a - d*x)**2*sin(c + d*x)*cos(c + d*x)/(8*d) + sin(a - d*x)*cos(a - d*x)*cos(c + d*x)**2/(2*d) + sin(c + d*x)*cos(a - d*x)**2*cos(c + d*x)/(8 *d), Eq(b, -d)), (3*x*sin(a + d*x)**2*sin(c + d*x)**2/8 + x*sin(a + d*x)** 2*cos(c + d*x)**2/8 + x*sin(a + d*x)*sin(c + d*x)*cos(a + d*x)*cos(c + d*x )/2 + x*sin(c + d*x)**2*cos(a + d*x)**2/8 + 3*x*cos(a + d*x)**2*cos(c + d* x)**2/8 - 5*sin(a + d*x)**2*sin(c + d*x)*cos(c + d*x)/(8*d) - sin(a + d*x) *cos(a + d*x)*cos(c + d*x)**2/(2*d) + sin(c + d*x)*cos(a + d*x)**2*cos(c + d*x)/(8*d), Eq(b, d)), ((x*sin(a + b*x)**2/2 + x*cos(a + b*x)**2/2 - sin( a + b*x)*cos(a + b*x)/(2*b))*sin(c)**2, Eq(d, 0)), (b**3*d*x*sin(a + b*x)* *2*sin(c + d*x)**2/(4*b**3*d - 4*b*d**3) + b**3*d*x*sin(a + b*x)**2*cos(c + d*x)**2/(4*b**3*d - 4*b*d**3) + b**3*d*x*sin(c + d*x)**2*cos(a + b*x)**2 /(4*b**3*d - 4*b*d**3) + b**3*d*x*cos(a + b*x)**2*cos(c + d*x)**2/(4*b**3* d - 4*b*d**3) - b**3*sin(a + b*x)**2*sin(c + d*x)*cos(c + d*x)/(4*b**3*d - 4*b*d**3) - b**3*sin(c + d*x)*cos(a + b*x)**2*cos(c + d*x)/(4*b**3*d - 4* b*d**3) - 2*b**2*d*sin(a + b*x)*sin(c + d*x)**2*cos(a + b*x)/(4*b**3*d ...
Leaf count of result is larger than twice the leaf count of optimal. 620 vs. \(2 (78) = 156\).
Time = 0.25 (sec) , antiderivative size = 620, normalized size of antiderivative = 7.05 \[ \int \sin ^2(a+b x) \sin ^2(c+d x) \, dx=\frac {8 \, {\left ({\left (b \cos \left (2 \, c\right )^{2} + b \sin \left (2 \, c\right )^{2}\right )} d^{3} - {\left (b^{3} \cos \left (2 \, c\right )^{2} + b^{3} \sin \left (2 \, c\right )^{2}\right )} d\right )} x + {\left (b^{2} d \sin \left (2 \, c\right ) - b d^{2} \sin \left (2 \, c\right )\right )} \cos \left (2 \, {\left (b + d\right )} x + 2 \, a + 4 \, c\right ) - {\left (b^{2} d \sin \left (2 \, c\right ) - b d^{2} \sin \left (2 \, c\right )\right )} \cos \left (2 \, {\left (b + d\right )} x + 2 \, a\right ) - {\left (b^{2} d \sin \left (2 \, c\right ) + b d^{2} \sin \left (2 \, c\right )\right )} \cos \left (-2 \, {\left (b - d\right )} x - 2 \, a + 4 \, c\right ) + {\left (b^{2} d \sin \left (2 \, c\right ) + b d^{2} \sin \left (2 \, c\right )\right )} \cos \left (-2 \, {\left (b - d\right )} x - 2 \, a\right ) - 2 \, {\left (b^{2} d \sin \left (2 \, c\right ) - d^{3} \sin \left (2 \, c\right )\right )} \cos \left (2 \, b x + 2 \, a + 2 \, c\right ) + 2 \, {\left (b^{2} d \sin \left (2 \, c\right ) - d^{3} \sin \left (2 \, c\right )\right )} \cos \left (2 \, b x + 2 \, a - 2 \, c\right ) + 2 \, {\left (b^{3} \sin \left (2 \, c\right ) - b d^{2} \sin \left (2 \, c\right )\right )} \cos \left (2 \, d x\right ) - 2 \, {\left (b^{3} \sin \left (2 \, c\right ) - b d^{2} \sin \left (2 \, c\right )\right )} \cos \left (2 \, d x + 4 \, c\right ) - {\left (b^{2} d \cos \left (2 \, c\right ) - b d^{2} \cos \left (2 \, c\right )\right )} \sin \left (2 \, {\left (b + d\right )} x + 2 \, a + 4 \, c\right ) - {\left (b^{2} d \cos \left (2 \, c\right ) - b d^{2} \cos \left (2 \, c\right )\right )} \sin \left (2 \, {\left (b + d\right )} x + 2 \, a\right ) + {\left (b^{2} d \cos \left (2 \, c\right ) + b d^{2} \cos \left (2 \, c\right )\right )} \sin \left (-2 \, {\left (b - d\right )} x - 2 \, a + 4 \, c\right ) + {\left (b^{2} d \cos \left (2 \, c\right ) + b d^{2} \cos \left (2 \, c\right )\right )} \sin \left (-2 \, {\left (b - d\right )} x - 2 \, a\right ) + 2 \, {\left (b^{2} d \cos \left (2 \, c\right ) - d^{3} \cos \left (2 \, c\right )\right )} \sin \left (2 \, b x + 2 \, a + 2 \, c\right ) + 2 \, {\left (b^{2} d \cos \left (2 \, c\right ) - d^{3} \cos \left (2 \, c\right )\right )} \sin \left (2 \, b x + 2 \, a - 2 \, c\right ) + 2 \, {\left (b^{3} \cos \left (2 \, c\right ) - b d^{2} \cos \left (2 \, c\right )\right )} \sin \left (2 \, d x\right ) + 2 \, {\left (b^{3} \cos \left (2 \, c\right ) - b d^{2} \cos \left (2 \, c\right )\right )} \sin \left (2 \, d x + 4 \, c\right )}{32 \, {\left ({\left (b \cos \left (2 \, c\right )^{2} + b \sin \left (2 \, c\right )^{2}\right )} d^{3} - {\left (b^{3} \cos \left (2 \, c\right )^{2} + b^{3} \sin \left (2 \, c\right )^{2}\right )} d\right )}} \]
1/32*(8*((b*cos(2*c)^2 + b*sin(2*c)^2)*d^3 - (b^3*cos(2*c)^2 + b^3*sin(2*c )^2)*d)*x + (b^2*d*sin(2*c) - b*d^2*sin(2*c))*cos(2*(b + d)*x + 2*a + 4*c) - (b^2*d*sin(2*c) - b*d^2*sin(2*c))*cos(2*(b + d)*x + 2*a) - (b^2*d*sin(2 *c) + b*d^2*sin(2*c))*cos(-2*(b - d)*x - 2*a + 4*c) + (b^2*d*sin(2*c) + b* d^2*sin(2*c))*cos(-2*(b - d)*x - 2*a) - 2*(b^2*d*sin(2*c) - d^3*sin(2*c))* cos(2*b*x + 2*a + 2*c) + 2*(b^2*d*sin(2*c) - d^3*sin(2*c))*cos(2*b*x + 2*a - 2*c) + 2*(b^3*sin(2*c) - b*d^2*sin(2*c))*cos(2*d*x) - 2*(b^3*sin(2*c) - b*d^2*sin(2*c))*cos(2*d*x + 4*c) - (b^2*d*cos(2*c) - b*d^2*cos(2*c))*sin( 2*(b + d)*x + 2*a + 4*c) - (b^2*d*cos(2*c) - b*d^2*cos(2*c))*sin(2*(b + d) *x + 2*a) + (b^2*d*cos(2*c) + b*d^2*cos(2*c))*sin(-2*(b - d)*x - 2*a + 4*c ) + (b^2*d*cos(2*c) + b*d^2*cos(2*c))*sin(-2*(b - d)*x - 2*a) + 2*(b^2*d*c os(2*c) - d^3*cos(2*c))*sin(2*b*x + 2*a + 2*c) + 2*(b^2*d*cos(2*c) - d^3*c os(2*c))*sin(2*b*x + 2*a - 2*c) + 2*(b^3*cos(2*c) - b*d^2*cos(2*c))*sin(2* d*x) + 2*(b^3*cos(2*c) - b*d^2*cos(2*c))*sin(2*d*x + 4*c))/((b*cos(2*c)^2 + b*sin(2*c)^2)*d^3 - (b^3*cos(2*c)^2 + b^3*sin(2*c)^2)*d)
Time = 0.28 (sec) , antiderivative size = 80, normalized size of antiderivative = 0.91 \[ \int \sin ^2(a+b x) \sin ^2(c+d x) \, dx=\frac {1}{4} \, x + \frac {\sin \left (2 \, b x + 2 \, d x + 2 \, a + 2 \, c\right )}{16 \, {\left (b + d\right )}} + \frac {\sin \left (2 \, b x - 2 \, d x + 2 \, a - 2 \, c\right )}{16 \, {\left (b - d\right )}} - \frac {\sin \left (2 \, b x + 2 \, a\right )}{8 \, b} - \frac {\sin \left (2 \, d x + 2 \, c\right )}{8 \, d} \]
1/4*x + 1/16*sin(2*b*x + 2*d*x + 2*a + 2*c)/(b + d) + 1/16*sin(2*b*x - 2*d *x + 2*a - 2*c)/(b - d) - 1/8*sin(2*b*x + 2*a)/b - 1/8*sin(2*d*x + 2*c)/d
Time = 20.80 (sec) , antiderivative size = 177, normalized size of antiderivative = 2.01 \[ \int \sin ^2(a+b x) \sin ^2(c+d x) \, dx=\frac {2\,d^3\,\sin \left (2\,a+2\,b\,x\right )-2\,b^3\,\sin \left (2\,c+2\,d\,x\right )+b\,d^2\,\sin \left (2\,a-2\,c+2\,b\,x-2\,d\,x\right )-b\,d^2\,\sin \left (2\,a+2\,c+2\,b\,x+2\,d\,x\right )+b^2\,d\,\sin \left (2\,a-2\,c+2\,b\,x-2\,d\,x\right )+b^2\,d\,\sin \left (2\,a+2\,c+2\,b\,x+2\,d\,x\right )-2\,b^2\,d\,\sin \left (2\,a+2\,b\,x\right )+2\,b\,d^2\,\sin \left (2\,c+2\,d\,x\right )-4\,b\,d^3\,x+4\,b^3\,d\,x}{16\,b\,d\,\left (b^2-d^2\right )} \]
(2*d^3*sin(2*a + 2*b*x) - 2*b^3*sin(2*c + 2*d*x) + b*d^2*sin(2*a - 2*c + 2 *b*x - 2*d*x) - b*d^2*sin(2*a + 2*c + 2*b*x + 2*d*x) + b^2*d*sin(2*a - 2*c + 2*b*x - 2*d*x) + b^2*d*sin(2*a + 2*c + 2*b*x + 2*d*x) - 2*b^2*d*sin(2*a + 2*b*x) + 2*b*d^2*sin(2*c + 2*d*x) - 4*b*d^3*x + 4*b^3*d*x)/(16*b*d*(b^2 - d^2))